package com.itdfq.images.dao;

import com.itdfq.images.domain.Images;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author GocChin
 * @Date 2021/4/15 9:25
 * @Blog: itdfq.com
 * @QQ: 909256107
 */
@Mapper
public interface ImagesDao {
    @Select("select * from images ")
    List<Images> findByPage();

    @Insert("insert into images(uname,pname,path) values(#{uname},#{pname},#{path})")
    void insert(Images images);

    @Delete("delete from images where id = #{id}")
    void delete(int id);


    @Delete({"<script>" +
            " delete from  images  where id  in "+
            "<foreach collection='list' item='custId' open='(' close=')' separator=','> #{custId}</foreach> "+
            " </script>"})
    void deleteSelect(List<String> custId);
}
